package checkpoint;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextField;

public class RegisterNumberButton extends JButton implements ActionListener{

	private static final long serialVersionUID = 1L;
	private JTextField txtRegisterNbr;
	private JLabel statusBar;
	private Model guiModel;
	public RegisterNumberButton(JTextField txtRegisterNbr, Model guiModel, JLabel statusBar){
		super("Register Number");
		this.guiModel = guiModel;
		this.statusBar = statusBar;
		this.txtRegisterNbr = txtRegisterNbr;
		addActionListener(this);
	}

	public void actionPerformed(ActionEvent e) {
		guiModel.registerTime(txtRegisterNbr.getText().trim(), statusBar);
		
	}
}
